<?
include_once($base_dir.'manage/member/sh/api/member_merchantAPI.php');		//商户会员
include_once($base_dir.'manage/news/api/news_api.php');				//新闻
include_once($base_dir.'manage/cargo/api/cargo_orderAPI.php');		//货物
include_once($base_dir.'manage/vehicle/api/vehicle_infoAPI.php');	//车辆

/**
* 货源最新的8条消息
* @return String
*/
function getNewCargoTop8()
{

	$strHtml='';
	$aryTemp=getNewCargoInfo(8);
	if(is_array($aryTemp))
	{
		foreach($aryTemp as $key => $value)
		{
			//$text=substr_utf8('['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].'] '.$aryTemp[$key]["info_name"],44);
			$text='['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].'] '.$aryTemp[$key]["info_name"];
			$text=str_replace('['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].']','<span class="addcolor">['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].']</span>',$text);
			$strHtml.='						<li><span class="cont"><a href="'.$aryTemp[$key]["url"].'" title="'.$aryTemp[$key]["info_name"].'">'.$text.'</a></span><span class="date">'.date("m-d",$aryTemp[$key]["createtime"]).'</span></li>';
		}
	}
	return $strHtml;
}


/**
* 车源最新的8条消息
* @return String
*/
function getNewVehicleTop8()
{

	$strHtml='';
	$aryTemp=getNewVehicleInfo(8);
	if(is_array($aryTemp))
	{
		foreach($aryTemp as $key => $value)
		{
			//$text=substr_utf8('['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].'] '.$aryTemp[$key]["text"],52);
			$text='['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].'] '.$aryTemp[$key]["text"];
			$text=str_replace('['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].']','<span class="addcolor">['.$aryTemp[$key]["from_cityname"].'-'.$aryTemp[$key]["to_cityname"].']</span>',$text);
			$strHtml.='						<li><span class="cont"><a href="'.$aryTemp[$key]["url"].'" title="'.$aryTemp[$key]["text"].'">'.$text.'</a></span><span class="date">'.date("Y-m-d",$aryTemp[$key]["createtime"]).'</span></li>';
		}
	}
	return $strHtml;
}

/**
* 取得诚信会员前十
* @param num		数据数量
* @return String
*/
function getRMListTop10_index()
{
	global $db;
	$strHtml='';
	$aryTemp=getRMInfo(10);
	if(is_array($aryTemp))
	{
		foreach($aryTemp as $key => $value)
		{
			$strHtml.='					<li><a href="'.$aryTemp[$key]["url"].'" target="_blank">'.$aryTemp[$key]['companyname'].'</a></li>';
		}
	}
	return $strHtml;
}

/**
* 首页物流资讯
* @param num		数据数量
* @return String
*/
function getNewsList_index()
{

	$strHtml='';
	$aryTemp=getNewsInfo('',5);
	if(is_array($aryTemp))
	{
		foreach($aryTemp as $key => $value)
		{
			$strHtml.='<li><span class="span_img"><img src="images/icon/li.gif" /></span><span><a href="'.$aryTemp[$key]["url"].'" target="_blank" title="'.$aryTemp[$key]["news_title"].'">'.$aryTemp[$key]["news_title"].'</a></span></li>';
		}
	}
	return $strHtml;
}
?>